const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const userRoutes = require('./routes/userRoutes');
const ruleRoutes = require('./routes/ruleRoutes');
const app = express();
app.use(cors({
    origin: 'http://localhost:8000',
    credentials: true
}));
app.use(bodyParser.json());
app.use('/api', userRoutes);
app.use('/api', ruleRoutes);
app.get('/', (req, res) => {
    res.send('Hello from CMS Backend!');
});
const PORT = 3000;
app.listen(PORT, () => {
    console.log(`Server is running on port ${PORT}`);
});
